package com.example.oldkingdom.utils;

import com.example.oldkingdom.MainActivity;
import com.example.oldkingdom.items.item;
import android.app.Activity;

public class saveUtils 
{
	
	public static final String Pref_Inventory = "Inventory: ";
	
	public static void save()
	{
		for (item _item : item.allItems )
		{
			MainActivity.Instance.getPreferences(Activity.MODE_PRIVATE).edit().putInt(Pref_Inventory + _item.getName(), _item.getPlayerQuantity());
		}
	}
	public static void load()
	{
		for (item _item : item.allItems )
		{
			_item.setPlayerQuantity(MainActivity.Instance.getPreferences(Activity.MODE_PRIVATE).getInt(Pref_Inventory + _item.getName(), 0));
		}
	}


}
